package com.jj.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    public static Date StringToDate(String dateTime) {
        String format="yyyy-MM-dd";
        SimpleDateFormat sdf=new SimpleDateFormat(format);
        Date date=null;
        try {
            //将字符串解析为日期类型
            date=sdf.parse(dateTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date;
    }
}
